<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=<?=$this->config->item('charset');?>">
	<title>用户注册_<?=$this->config->item('site_name');?></title>
	<link href="<?=base_url('static/css/global.css')?>" rel="stylesheet" type="text/css" media="screen">
	<link href="<?=base_url('static/css/login.css')?>" rel="stylesheet" type="text/css" media="screen">
	<script src="<?=path_res('static/js/jquery.js')?>"></script>
	<script src="<?=path_res('static/js/functions.js')?>"></script>
</head>
<body>

<? $this->load->view('header'); ?>
<div id="main" class="clearfix">
	<input id="needcolselead" type="hidden" value="OK">
	<div class="bgrf clearfix">
			<div class="nsoine">
				<div class="thplat">
					<h2>注册</h2>
					<h3>使用以下账号快速登录</h3>
					<div class="rplate">
						<a class="btnrqq mrl left" href="<?=site_url('user/api_connect/QQ')?>" title="QQ账号登录" target="_blank">QQ账号登录</a>
						<a class="btnrsina mrl left" href="<?=site_url('user/api_connect/Sina')?>" title="新浪微博登录" target="_blank">新浪微博登录</a>
					</div>
				</div>
				
				<div class="logbox">
					<h3>注册一个邮箱账号</h3>
					<div class="logone">
						<form action="<?=site_url('user/register')?>" method="post" onsubmit="return signup();" onkeydown="if(event.keyCode==13){return false;}">
							<div class="itm clearfix">
								<label>邮箱</label>
								<div class="iput">
									<input id="email" name="email" onblur="checkemail('register');" onfocus="showdesc(this);" value="" class="retext" type="text">
								</div>
								<span class="lowrong mll">请输入邮箱</span>
							</div>
							<div class="iisi" style="visibility: hidden;">输入常用邮箱，便于登录和找回密码</div>
							<div class="itm clearfix">
								<label>昵称</label>
								<div class="iput">
									<input id="username" name="username" onblur="checknickname();hidedesc(this);" onfocus="showdesc(this);" value="" class="retext" maxlength="20" type="text">
								</div>
								<span> </span>
							</div>
							<div class="iisi">吃货也要有名字，但长度不超过16个字~</div>
							<div class="itm clearfix">
								<label>密码</label>
								<div class="iput">
									<input id="password" name="password" value="" onkeydown="if(event.keyCode=='32'){return false;}" onblur="checkpassword();hidedesc(this);" onfocus="showdesc(this);" class="retext" maxlength="20" type="password">
								</div>
								<span></span>
							</div>
							<div class="iisi">密码长度为6-20位，不能含有空格</div>
							<div class="itm clearfix">
								<label>确认密码</label>
								<div class="iput">
									<input id="confirm_password" name="confirm_password" onkeydown="if(event.keyCode=='32'){return false;}" onblur="checkdoublepassword();hidedesc(this);" onfocus="showdesc(this);" value="" class="retext" maxlength="20" type="password">
								</div>
								<span></span>
							</div>
							<div class="iisi">再输入一次密码</div>

							<?php if ($this->config->item('captcha_registration')): ?>
							<div class="itm clearfix">
								<div class="yanma ml70">
									<input id="captcha" name="captcha" value="" onblur="checkcode()" class="yzmtext" maxlength="8" type="text" placeholder="输入验证码"> <img id='codeshow' src="<?=site_url('ajax/captcha_image')?>" onclick="javascript:this.src='<?=site_url('ajax/captcha_image')?>?'+Math.floor(Math.random()*99)" style="cursor:pointer;border-radius:4px 4px 4px 4px" title="看不清? 换一张"/> 
								</div>
							</div>
							<div class="iisi">请填写校验码</div>
							
							<?php endif; ?>
							<div class="iloo">
								<input type="hidden" id="urlreferer" name="urlreferer" value="<?=site_url()?>">
								<span class="lxieyi mb30"> 
									<label><input type="checkbox" checked="checked" class="czl" id="agreement"> 我已阅读并且同意</label> <a href="<?=site_url('siteinfo/?menu=protocol')?>" target="_blank" title="用户协议">爱厨房使用协议</a> 
									<b id="agreement_tip" class="fwn ff0 pls"><?=$error_info?></b>
								</span>
								<button id="doLogin" type="button" onclick="return signup();" class="btnrdz">注册</button>
								<span class="plm">已有账号，<a href="<?=site_url('user/login')?>">从这里登录</a></span>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
</div>



<script type="text/javascript">
$(document).ready(function(){
	$("#email").focus();
	/*
    if(checkemailsignup() == true)
    {
        checknickname();
    }*/
    $("#email").emailMatch();

});

function checkcode(){
    var code=$.trim($('#captcha').val());  
    $.post("/uajax/ajaxcode",{code: code}, function(flag){
        if(1==flag){
            hidedesc($('#captcha'));
        }else{
            showdesc($('#captcha'));
        }
    });
}
</script>
<script src="<?=path_res('static/js/signup.js')?>"></script>
<? $this->load->view('footer'); ?>